﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NLite.Validation
{
    /// <summary>
    /// 
    /// </summary>
    public class ValidationFailureType
    {
        /// <summary>
        /// 
        /// </summary>
        public const int DataValidationFailure = 0;

        /// <summary>
        /// 
        /// </summary>
        public const int BusinessValidationFailure = 1;

        /// <summary>
        /// 
        /// </summary>
        public const int MapperValidationFailure = 2;
    }

    /// <summary>
    /// 
    /// </summary>
    public interface  IValidationResult
    {
        /// <summary>
        /// 
        /// </summary>
        IEnumerable<IValidationFailure> Errors { get; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="memberName"></param>
        /// <param name="errorMessage"></param>
        void AddModelError(string memberName, string errorMessage);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="memberName"></param>
        /// <param name="errorMessage"></param>
        void AddModelError(int type, string memberName, string errorMessage);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="validatorType"></param>
        /// <param name="memberName"></param>
        /// <param name="errorMessage"></param>
        void AddModelError(Type validatorType, string memberName, string errorMessage);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="validatorType"></param>
        /// <param name="memberName"></param>
        /// <param name="errorMessage"></param>
        void AddModelError(int type, Type validatorType, string memberName, string errorMessage);

        /// <summary>
        /// 
        /// </summary>
        bool IsValid { get; }
    }
}
